package com.bakar.valueobjects;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.Transient;

@Entity(name="Users")
public class UserVO  implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public UserVO() {
		super();
	}

	@Id
	private String loginId;
	
	@Column(name="displayName", length=100,nullable=false)
	private String displayName;
	
	@Column(name="imagePath", length=20,nullable=false)
	private String imagePath;
	
	@Column(name="status", length=10,nullable=false)
	private String status;
	
	@Transient
	private String frndStatus;

	public String getLoginId() {
		return loginId != null?loginId.toLowerCase() :null;
	}

	public void setLoginId(String loginId) {
		if (loginId != null){
			this.loginId = loginId.toLowerCase();
		}
		
	}

	public String getDisplayName() {
		return displayName;
	}

	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}

	public String getImagePath() {
		return imagePath;
	}

	public void setImagePath(String imagePath) {
		this.imagePath = imagePath;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return loginId.hashCode();
	}

	@Override
	public boolean equals(Object obj) {

		if (obj == null)
			return false;
		if (obj instanceof UserVO)
			return loginId.equalsIgnoreCase(((UserVO) obj).getLoginId());
		return false;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return loginId;
	}
	
	public UserVO(String loginId){
		this.loginId = loginId; 
		this.displayName = loginId;
	}

	public void setFrndStatus(String frndStatus) {
		this.frndStatus = frndStatus;
	}

	public String getFrndStatus() {
		return frndStatus;
	}

	

	

	
}
